#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;
using db = double;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 2e5 + 10;

int n, a[N];
int ans[N][2];
int res[N];

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in; rep(i, 1, n) a[i] = in;
	db mg = 1, ms = -1e9;
	rep(i, 1, n) {
		db tmg = mg, tms = ms;
		if(ms / a[i] >= tmg) {
			ans[i][0] = 1; tmg = ms / a[i];
		} else ans[i][0] = 0;
		if(mg * a[i] >= tms) {
			ans[i][1] = 1; tms = mg * a[i];
		} else ans[i][1] = 0;
		mg = tmg; ms = tms;
		ms /= mg; mg = 1;
	}
	int st = 0;
	per(i, n, 1) {
		res[i] = ans[i][st];
		st ^= ans[i][st];
	} assert(st == 0); rep(i, 1, n) printf("%d ", res[i]);
}
